home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C++ / Applications / NeuroSim 1.0 / .h / CNeuroSimPane.h < prev    next >
Text File  |  1996-02-19  |  2KB  |  55 lines

  1. // ===========================================================================
  2. //    CNeuroSimPane.h                ©1996 Timo Eloranta
  3. // ===========================================================================
  4. //    This class takes care of displaying the picture of the neural net.
  5. //    Derived from the PowerPlant LView class.
  6.  
  7. #pragma once                        // Include this header only once
  8.  
  9. #include <LView.h>
  10.  
  11. #include "NS_Types.h"
  12.  
  13. class    LGWorld;
  14. class    CNeuralNet;
  15.  
  16. class    CNeuroSimPane : public LView {
  17. public:
  18.     enum { 
  19.         class_ID = 'NePa'        // ID used by Metrowerks Constructor
  20.     };
  21.  
  22.     static CNeuroSimPane*    CreateNeuroSimPaneStream( LStream *inStream );
  23.  
  24.                             CNeuroSimPane( LStream *inStream );
  25.     virtual                    ~CNeuroSimPane();
  26.     
  27.     virtual void            SetNet( CNeuralNet * inNet );
  28.                         
  29.     virtual void            InvalidateDrawing();
  30.  
  31. protected:
  32.     CNeuralNet            *mNet;                // Our net object
  33.     LGWorld                *mGWorld;            // Our offscreen graphics world
  34.     
  35.     Uint16                mGridSize;            // Size of the net
  36.  
  37.     Rect                mOneOneRect;        // The rect of the [1,1] neuron
  38.     Rect                mGridRect;            // The rect of the whole matrix
  39.     
  40.     Boolean                mDrawingIsDirty;        // Redraw needed ?
  41.     Boolean                mBackgroundIsDirty;        // Redraw needed (bg) ?
  42.     
  43.     virtual void        ClickSelf( const SMouseDownEvent &inMouseDown);
  44.     
  45.     virtual Boolean        PointToSquare(    const Point & inPoint, 
  46.                                         Uint16 & outCol, 
  47.                                         Uint16 & outRow );
  48.     virtual void        DrawSelf();
  49.     virtual void        DrawTheNet();
  50.     virtual void        DrawBackground();
  51.     virtual void        DrawConnections();
  52.     virtual void        DrawNeurons();    
  53.     virtual void        DrawFrame();
  54. };
  55.